import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        //判断登陆状态
        isLogin:false,
        //用户信息
        userInfo:{},
        //解决登陆状态的异步请求问题
        loginPromise:null,
    },
    mutations:{
        changeIsLogin(state,payload){
            state.isLogin = payload.isLogin;
        },
        changeUserInfo(state,payload){
            state.userInfo = payload.userInfo;
        },
        changeLoginPromise(state,payload){
            state.loginPromise = payload.loginPromise
        }
    },
    actions:{

    }
})